<?php
class Mwc_SystemPoint_Block_Userpoint_New_Form extends Mage_Adminhtml_Block_Widget_Form{    
    protected function _prepareForm(){
//    	$model = Mage::getModel('systempoint/userpoint');
//        $collection = $model->getCollection();
//		$this->setCollection($collection);
//        print_r($collection);
        $form = new Varien_Data_Form();
 
        $fieldset = $form->addFieldset('new_userpoint', array('legend' => Mage::helper('systempoint')->__('User Point Details')));
 
        $fieldset->addField('group_title', 'text', array(
            'name'      => 'group_title',
            'title'     => Mage::helper('systempoint')->__('Group name'),
            'label'     => Mage::helper('systempoint')->__('Group name'),  
        ));
//        $group->setRenderer($this->getLayout()->createBlock('systempoint/userpoint_render_group'));
        
        $fieldset->addField('shadow_point', 'text', array(
            'name'      => 'shadow_point',
            'title'     => Mage::helper('systempoint')->__('Point'),
            'label'     => Mage::helper('systempoint')->__('Point'),            
            'required'  => true,
        ));
        
        /*$fieldset->addField('add_date', 'date', array(
          'label'     => Mage::helper('systempoint')->__('Add date'),
          'name'      => 'add_date',
          'after_element_html' => '',
          'tabindex' => 1, 
	      'required'  => true,
          'image' => $this->getSkinUrl('images/grid-cal.gif'),
          'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_LONG)
        ));
        
        $fieldset->addField('expire_date', 'date', array(
          'label'     => Mage::helper('systempoint')->__('Expire date'),
          'name'      => 'expire_date',
          'after_element_html' => '',
          'tabindex' => 1, 
	      'required'  => true,
          'image' => $this->getSkinUrl('images/grid-cal.gif'),
          'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_LONG)
        ));*/
        
        $field = $fieldset->addField('kindofuser', 'checkbox', array(
          'label'     => Mage::helper('systempoint')->__('New user?'),
          'name'      => 'kindofuser',
          'onclick' => "modifyTargetElement(this.checked)",
          'onchange' => "",
          'disabled' => false,
          'readonly' => false, 
          'after_element_html' => '',
          'tabindex' => 1
        ));
        
        $field->setRenderer($this->getLayout()->createBlock('systempoint/userpoint_render_fields'));
        		
        $form->setMethod('post');
        $form->setUseContainer(true);
        $form->setId('edit_form');
        $form->setAction($this->getUrl('*/*/post'));
 
        $this->setForm($form);
    }
}